<template>
  <div class="homework-container">
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="120px"
      class="demo-ruleForm"
    >
      <el-form-item label="作业名称：" prop="homework_name" style="white-space:nowrap;">
        <el-input v-model="ruleForm.homework_name" style="width: 400px; height: 36px"></el-input>
      </el-form-item>
      <el-form-item label="作业内容：">
        <Ueditor ref="ue"></Ueditor>
      </el-form-item>
    </el-form>    
  </div>
</template>
<script>
import Ueditor from '@/common/editor/editor'
export default {
  data() {
    return{
      ruleForm: {
        homework_name: ''
      },
      rules:{
        homework_name: [{required: true, message: '请输入作业名称', trigger: 'blur'}]
      }
    }
  },
  methods: {
    formatParams() {
      let content = this.$refs.ue.content
      this.ruleForm.homework_content = content
      this.$emit('homeWorkParams', this.ruleForm)
    }
  },
  components: {
    Ueditor
  }
}
</script>
<style lang="scss" scoped>
.homework-container{
  padding: 20px;
  position: relative;
  top: 135px;
}
</style>